build: enable no-parentheses in clang
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 17 Feb 2017 15:10:28 +0000 (16:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 17 Feb 2017 15:10:28 +0000 (16:10 +0100)
And fix the following errors reported:

traps.c:2014:25: error: equality comparison with extraneous parentheses
      [-Werror,-Wparentheses-equality]
        else if ( (port == RTC_PORT(0)) )
                   ~~~~~^~~~~~~~~~~~~~
traps.c:2014:25: note: remove extraneous parentheses around the comparison to silence this warning
        else if ( (port == RTC_PORT(0)) )
                  ~     ^             ~
traps.c:2014:25: note: use '=' to turn this equality comparison into an assignment
        else if ( (port == RTC_PORT(0)) )
                        ^~
                        =
traps.c:2083:25: error: equality comparison with extraneous parentheses
      [-Werror,-Wparentheses-equality]
        else if ( (port == RTC_PORT(0)) )
                   ~~~~~^~~~~~~~~~~~~~

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Config.mk
xen/arch/x86/traps.c

index bff4dc55848487657d2b67a40b9f530cd231eedc..9a28d15a9d90f7da9cd9fec59987abe63e3b790e 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -212,9 +212,6 @@ CFLAGS += -std=gnu99
 
 CFLAGS += -Wall -Wstrict-prototypes
 
-# Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
-CFLAGS-$(clang) += -Wno-parentheses
-
 $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
 $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
 $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable)
index ae4a8fa6366528916aeb0051ec44190d5531f5d9..ec8b002f6e5b8d570c64e523e0087034c2f6c9e3 100644 (file)
@@ -2010,7 +2010,7 @@ uint32_t guest_io_read(unsigned int port, unsigned int bytes,
         {
             sub_data = pv_pit_handler(port, 0, 0);
         }
-        else if ( (port == RTC_PORT(0)) )
+        else if ( port == RTC_PORT(0) )
         {
             sub_data = currd->arch.cmos_idx;
         }
@@ -2079,7 +2079,7 @@ void guest_io_write(unsigned int port, unsigned int bytes, uint32_t data,
         {
             pv_pit_handler(port, (uint8_t)data, 1);
         }
-        else if ( (port == RTC_PORT(0)) )
+        else if ( port == RTC_PORT(0) )
         {
             currd->arch.cmos_idx = data;
         }